package homework_03;

public class Work13 {
    public static void main(String[] args) {
        //分别使用for循环，while循环，do循环求1到100之间所有能被3整除的整数的和。
        int sum1 = 0;
        for(int i = 3 ; i < 100 ; i+=3){
            sum1 += i;
        }
        System.out.println("for==="+sum1);
        System.out.println("--------------------------------------");
        int sum2 = 0;
        int i = 3;
        while( i < 100 ){
            sum2 += i;
            i += 3;
        }
        System.out.println("while==="+sum2);
        System.out.println("--------------------------------------");
        int sum3 = 0;
        int i1 = 3;
        do{
            sum3 += i1;
            i1 += 3;
        }while( i1 < 100);
        System.out.println("do while==="+sum3);
    }
}
